<?php

class __module_admin {

    var $ver    = "0.01";
	var $urls   = array(		// This list pages in module. array( "default" => "default_page_name", "namepage" => "nameclass" )
					"default"	  => "def",

					"def"		  => "page_default",
					"SCI"         => "controller_SoulCloudInstaller",
					"content"     => "controller_content",
					"acsgp"		  => array('admin_acsgp', 2, 'arguments'),
					
					"block_menu"  => "block_menu"

				);

    function page_default() {
        __driver_display::si()->assign('kernel_ver', __kernel_api::getKernelVer());
        __driver_display::si()->assign('installed_modules', &__kernel_init::$modules);
        

        return __driver_display::si()->fetch(array('default.html', new KT_start_moduleName('admin')));
    }
    
    
    function controller_SoulCloudInstaller($args) {
            if(!isset($_GET[2]))   return __kernel_start::si('admin_SCI')->main();
        elseif($_GET[2] == "repo") return __kernel_start::si('admin_SCI')->repo();
    }
    
    function controller_content($args) {
    		if(!isset($_GET[2]))  return __kernel_start::si('admin_content')->main();
    	elseif($_GET[2] == 'add' && $_GET['3'] == 'ajax') __kernel_start::si('admin_content')->add_ajax($_GET['4']);
   		elseif($_GET[2] == 'add') return __kernel_start::si('admin_content')->add();
    }
    
    function block_menu() {
        return __driver_display::si()->fetch(array('block_menu.html', new KT_start_moduleName('admin')));
    }
    
    // Controller for install pages
    function install() {
        $admi = new __module_admin_install();
        
            if($_GET[1] == "")      return $admi->step1();
        elseif($_GET[1] == "step1") return $admi->step2();
        elseif($_GET[1] == "step2") return $admi->step3();
        elseif($_GET[1] == "step3") return $admi->step4();
    }

    public function __construct() {
    	drv(DISP)->changeTemplates('system_index.html');
    }
    
}
?>
